/*--------------------------------------------------------------
 * File: demo36.c 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 实现简单的计算器
 * 实现加减乘除运算
 * Version 0.1
 * Date 2022-02-04 
 * 
 * @copyright Copyright (c) 2022
 * 
----------------------------------------------------------------*/
#include <stdio.h>

int main(int argc, char const *argv[])
{
    char operator;
    double firstNUM, secondNUM;
    printf("输入计算公式：");
    scanf("%lf %c %lf",&firstNUM, &operator, &secondNUM);

    switch (operator)
    {
        case '+':
            printf("%0.1f + %0.1f = %.1lf\n",firstNUM, secondNUM, firstNUM + secondNUM);
            break;
        case '-':
            printf("%0.1f - %0.1f = %.1lf\n",firstNUM, secondNUM, firstNUM - secondNUM);
            break;
        case '*':
            printf("%0.1f * %0.1f = %.1lf\n",firstNUM, secondNUM, firstNUM * secondNUM);
            break;
        case '/':
            printf("%0.1f / %0.1f = %.1lf\n",firstNUM, secondNUM, firstNUM / secondNUM);
            break;
        
        default:
            break;
        }
    return 0;
}
